package com.br.homebank.views;

import java.awt.BorderLayout;
import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;

public class AccountView {

	public static JFrame getView() {
		JFrame frame = new JFrame( "Cadastrar Conta" );
		JPanel panelContainer = new JPanel();
		panelContainer.setLayout( new GridLayout( 3, 1 ) );

		JPanel panelRadios = new JPanel( new BorderLayout() );
		panelRadios.add( new JRadioButton( "Corrente" ), BorderLayout.LINE_START );
		panelRadios.add( new JRadioButton( "Poupança" ) );
		panelContainer.add( panelRadios );

		JPanel panelButtons = new JPanel( new GridLayout( 2, 2 ) );
		JPanel panel1 = new JPanel( new BorderLayout() );
		panel1.add( new JLabel( "Cliente " ), BorderLayout.LINE_START );
		panel1.add( new JTextField() );
		panelButtons.add( panel1 );

		panel1 = new JPanel( new BorderLayout() );
		panel1.add( new JLabel( "Número " ), BorderLayout.LINE_START );
		panel1.add( new JTextField() );
		panelButtons.add( panel1 );

		panel1 = new JPanel( new BorderLayout() );
		panel1.add( new JLabel( "Limite   " ), BorderLayout.LINE_START );
		panel1.add( new JTextField() );
		panelButtons.add( panel1 );

		panelContainer.add( panelButtons );

		panelButtons = new JPanel( new BorderLayout() );
		JPanel grid = new JPanel( new GridLayout( 1, 2 ) );
		JButton jButton = new JButton( "Salvar" );
		grid.add( jButton );
		JButton jButton2 = new JButton( "Limpar" );
		grid.add( jButton2 );
		panelButtons.add( grid, BorderLayout.LINE_START );
		panelContainer.add( panelButtons );

		frame.add( panelContainer );
		frame.setSize( 600, 200 );
		frame.setLocationRelativeTo( null );
		frame.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE );
		return frame;
	}
}
